package neurons;

import java.util.HashSet;
import java.util.Set;

import org.neo4j.graphdb.Node;

public class Neuron implements NeuronInterface {

	protected Node node;
	protected FonctionDeSeuilInterface fonctionDeSeuil;

	protected Set<NeuronInterface> incomingNeurons;
	protected Set<NeuronInterface> outgoingNeurons;

	public Neuron(Node node, FonctionDeSeuilInterface fonctionDeSeuil) {
		this.node = node;
		this.fonctionDeSeuil = fonctionDeSeuil;

		incomingNeurons = new HashSet<NeuronInterface>();
		outgoingNeurons = new HashSet<NeuronInterface>();
	}

	
	
	@Override
	public Set<NeuronInterface> getIncomingNeurons() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Set<NeuronInterface> getOutgoingNeurons() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void sendDendritTo(NeuronInterface targetNeuron) {
		targetNeuron.acceptDendrit(this);
		outgoingNeurons.add(targetNeuron);
	}

	@Override
	public void acceptDendrit(Neuron neuron) {
		incomingNeurons.add(neuron);
	}

	@Override
	public Signal propagate(Signal signal) {
		return fonctionDeSeuil.propagate(signal);
	}

}
